<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="format-detection" content="telephone=no">
    <meta content="yes" name="apple-touch-fullscreen"/>
    <title>装备</title>
    <link rel="stylesheet" href="/static/css/base.css?v={$staticVersion}"/>
    <link rel="stylesheet" href="/static/css/equip.css?v={$staticVersion}"/>
    <link rel="stylesheet" href="/static/css/show/dropload.css?v={$staticVersion}"/>
    <link rel="stylesheet" href="/static/css/groupbuying.css?v={$staticVersion}"/>

    <style>
    
    </style>
</head>
    
<body>
    {if $isNewVersion=='false'}
    <header class="equip-head">
        <input id="search" type="text" name="w" placeholder="搜索你想要的装备" autocomplete="off">
        <a href="joggers://gearAdvisor" class="measure"><i></i>测一测</a>
        <!-- <a href="joggers://gearStore" class="me" style="display: none"><i class="me"></i>我的</a> -->
    </header>
    {/if}
    <nav class="home-nav p10 line-gray-bottom">
        {loop $category $k $v}
        <a href="$v['link']">
            <img src="$v['logo']">
            $v['catName']
        </a>
        {/loop}
    </nav>
    <!-- 导航 -->
    <h2 class="blue-line f16 line-gray">
        限时团购
        <a href="grouponList?sort=1&_track=homegrouponmore" class="color_gray fr">查看更多</a>
    </h2>
    {if !empty($groupon)}
    <ul class="goods-list  line-gray-bottom">
       <li>
            <a href="groupondetail?flashId={$groupon['id']}&_track=homegroupon&_trackValue={$groupon['id']}">
            <i class="today"></i>
            <img class="shop-img" src="{$groupon['image']}">
            <h4 class="omit">{$groupon['title']}</h4>
            <p class="time" data-endtime="{$groupon['end_time']}" data-prefix="$groupon['button']['status_msg']">
               
            </p>
            <span class="red">￥{$groupon['low_price']}</span>
            起
            <small>￥{$groupon['cost_price']}</small>

            <div class="btn-box">
                <span class={$groupon['button']['buy2_class']}>{$groupon['button']['buy2']}</span>
                <br>
                {$groupon['num_msg']}
            </div>
            </a>
       </li>
    </ul>
    {else}
        <div>
        <a href="grouponList?sort=1">
            <img src="/static/images/img/tgimg.jpg" width="100%">
        </a>
        </div>
    {/if}
    <!-- 团购 -->
    <section class="good-price line-gray-bottom">
        <h2 class="blue-line f16 line-gray">每日好价</h2>
        <ul >
            {loop $bestGear $k $v}
            <li>
                <a href="equipment?gearId=$v['gearId']&_track=homegoodprice"> </a>
                <div class="img-box">
                    <img src="$v['images']">
                </div>
                <p class="omit ac">$v['name']</p>
                <div class="">
                    <span class="color-red db f14">￥{if empty($v['min_price'])} $v['price']{else}$v['min_price']{/if}</span> 
                    <span class="color_gray db f12">{if !empty($v['min_price'])}￥$v['price']{/if}</span>
                </div>
               
            </li>
            {/loop}
        </ul>
    </section>
    <!-- 每日好价 -->
    <dl class="pn-recommend">
        <dt class="blue-line line-gray">
            扑妞推荐
            <a href="gearNewsList?_track=homenewsmore" class="color_gray fr">查看更多</a>
        </dt>
        {loop $newsList $k $v}
        <a href="joggers://news/$v['news_id']" onclick="trackevent('homenews',$v['news_id'])">
        <dd class="line-gray-bottom p10">
            <h3>$v['title']</h3>
            <div class="img-list">
                {loop $v['thumb_img'] $k $img}
                <img src="$img">
                {/loop}
            </div>
        </dd>
        </a>
        {/loop}
    </dl>
    <!-- 扑妞推荐 -->
    <section>   
        <h2 class="blue-line f16">最新推荐</h2>
        <ul class="youlike pn">
        <div class="content">
            <div class="lists"></div>
        </div>
            <script id="recommendTemplate" type="text/html">
            <% for(var i=0;i<list.length;i++){ %>
            <li>
                <a href="equipment?gearId=<%=list[i].gearId%>&_track=homerecommend">
                <img src="<%if(list[i].images){%><%=list[i].images%><%}else{%>/static/images/4.jpg<%}%>">
                <h6 class="f14 color_dgray omit"><%=list[i].name%></h6>
                <p class="omit color_gray f12 mt5"><%=list[i].shortDesc%></p>
                <p class="color_red f12 mt10">
                    <span class="color-red f14">￥<%=list[i].price%></span>
                    <span class="color_gray fr">热度：<%=list[i].viewCounts%></span>
                </p>
                </a>
            </li>
             <% } %>
            </script> 
        </ul>
    </section>
    <!-- 最新推荐 -->
<div class="back-top _back-top"></div>

<script src="/static/js/show/zepto.min.js?v={$staticVersion}"></script>
<script src="/static/js/show/template-native.js?v={$staticVersion}"></script>
<script src="/static/js/show/dropload.min.js?v={$staticVersion}"></script>
<script src="/static/js/show/zepto.scroll.js?v={$staticVersion}"></script>
<script src="/static/js/show/gear.js?v={$staticVersion}"></script>

    <script>
      var page = 1;
       $(function(){
        // 页数
        loadrecommend();
        // dropload
        $('.content').dropload({
            scrollArea : window,//默认加载
            loadDownFn : function(me){
                if(page++>3){
                    me.lock();
                    me.noData();
                    me.resetload();
                    return;
                }
                loadrecommend(me);
            }
        });
    });

function loadrecommend(me){
     $.ajax({
        type: 'GET',
        url: '/ajax/recommendGear?page='+page,
        dataType: 'json',
        success: function(data){
            var arrLen = data.list.length;
            if(arrLen > 0){
                $('.lists').append(template('recommendTemplate',{'list':data.list}));
            }else{
                if(me){
                    me.lock();
                    me.noData();
                }
            }
            if(me){
                me.resetload();
            }
        },
        error: function(xhr, type){
            if(me){
                me.noData();
                me.resetload();
            }
        }
    });
}


$("#search").click(function(){
    $(".mask-white").show();
    $("#read-search").focus()
});

starttimer({$current_time});

$(window).scroll(function(){
    var sc=$(window).scrollTop();
    var rwidth=$(window).width()+$(document).scrollLeft();
    var rheight=$(window).height()+$(document).scrollTop();
    if(sc>0){
        $("._back-top").css("display","block");
        // $(".back-top").css("left",(rwidth-80)+"px");
        // $(".back-topp").css("top",(rheight-120)+"px");
    }else{
        $("._back-top").css("display","none");
    }
});

$('.back-top').on('click', function(e) {
  $.scrollTo({
    endY: 0,
    duration: 200,
  });
});

    </script>
{template 'show/gearSearchComponent'}
</body>
{template 'show/web-gearfooter'}
<script type="text/javascript">
    if(typeof jw === "object" ) {
        jw.api('wv_setnav', JSON.stringify({
            "title": '',
            "nav": getNav([$shopcart])
        }), '')
    }
</script>